package com.doit.day04

import com.doit.day03.ScalaOrder


object _08_隐式方法 {
  def main(args: Array[String]): Unit = {

    //隐式类 ==》

    10.fly()

    11.eat()

    12.sleep()

    "hehe".fly()

    val order: ScalaOrder = new ScalaOrder("", "", "", "", 1, 1.0)

    order.fly()

  }

  implicit def str2ABC(str:Any):ABC={
    new ABC("zss")
  }

}



class ABC(str:String){

  def fly()={
    println(str + "飞起来了")
  }

  def eat()={
    println(str + "吃起来了")
  }

  def sleep()={
    println(str + "睡起来了")
  }


}